﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
namespace AccessWare
{
    public partial class DayReport : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string strSPNAme = "DayWiseRpeort";
            SPCalling objSPCalling = new SPCalling();
            DataSet ds = objSPCalling.ExecuteDataset(CommandType.StoredProcedure, strSPNAme);
            for (int intI = 1; intI < ds.Tables[0].Rows.Count; intI++)
            {
                ds.Tables[0].Rows[intI]["Closingbags"] = Convert.ToInt32(ds.Tables[0].Rows[intI]["Receiptbags"]) -
                    Convert.ToInt32(ds.Tables[0].Rows[intI]["issuebagsn"]) + Convert.ToInt32(ds.Tables[0].Rows[intI - 1]["Closingbags"]);
                ds.Tables[0].Rows[intI]["Closingntwt"] = Convert.ToInt32(ds.Tables[0].Rows[intI]["Receiptnetwt"]) -
                    Convert.ToInt32(ds.Tables[0].Rows[intI]["issuenetwt"]) + Convert.ToInt32(ds.Tables[0].Rows[intI - 1]["Closingntwt"]);
                ds.Tables[0].Rows[intI]["Openingbags"] = Convert.ToInt32(ds.Tables[0].Rows[intI - 1]["Closingbags"]);
                ds.Tables[0].Rows[intI]["Openingntwt"] = Convert.ToInt32(ds.Tables[0].Rows[intI - 1]["Closingntwt"]);

            }
            gdDayReport.DataSource = ds.Tables[0];
            gdDayReport.DataBind();
            gdDayReport.Visible = true;
            
        }
    }
}